<?php
class LevelController {
	public function lists(){
		return HttpServerManager::getLevelServer()->pagingBySearch($_GET);
	}
	public function add(){
		$data = array();
		if (!empty($_GET['id'])){
			$data = HttpDaoManager::getLevelDao()->get($_GET['id']);
		}
//		$level = Common::_t('course_level');
//		$levelOptions = page_modifier_options($level,getStr($data,'level'));
//		$data['levelOptions'] = $levelOptions;
		$data['id']= getParamValue('id');
		
		return $data;
	}
	public function subAdd(){
		$data = $_POST;
		$data['add_time'] = time();
		HttpDaoManager::getLevelDao()->add($data);
		ClassManager::getToos()->msgbox(Common::_t('data_insert_success'));
	}
	public function subUpdate(){
		HttpServerManager::getLevelServer()->update($_POST, $_POST['id']);
		ClassManager::getToos()->msgbox(Common::_t('data_edit_success'),'Level_lists.html');
	}
	public function delete(){
		HttpServerManager::getLevelServer()->deleteBatchByid($_GET['id']);
		ClassManager::getToos()->msgbox(Common::_t('data_del_success'));
	}
}
?>